#include <stdio.h>
int dominantIndex(int* nums, int numsSize) {
    int max = *nums;
    int i = 0;
    int flag = 0;
    for (i = 0; i < numsSize; i++)
    {
        if (max < *(nums + i))
        {
            max = *(nums + i);
            flag = i;
        }
    }
    for (i = 0; i < numsSize; i++)
    {
        int tmp = 2 * (*(nums + i));
        if (i == flag)
        {
            tmp = 0;
        }
        if (max >= tmp)
        {
            continue;
        }
        return -1;
    }
    return flag;
}
int main()
{
    int nums[] = { 3,6,1,0 };
    int ret = dominantIndex(nums, 4);
    printf("%d\n", ret);
    return 0;
}